#ifndef BLOGITEM_H
#define BLOGITEM_H

#include <QWidget>
#include <QMouseEvent>
#include <QString>
#include <QLabel>
#include <QVBoxLayout>
#include <QDebug>

namespace Ui {
class BlogItem;
}

class BlogItem : public QWidget
{
    Q_OBJECT

public:
    explicit BlogItem(QWidget *parent = nullptr,  QMap<QString, QString> *map=nullptr);
    ~BlogItem();
    bool eventFilter(QObject *obj, QEvent *event);	// 添加时间过滤器声明
    void setPraise(bool isPraise, QString p);
    void setCollection(bool isCollection, QString c);
    void setComment(QString c);

private:
    Ui::BlogItem *ui;
    QString blogUser;
    QString blogTitle;
    QString blogOverview;
    QString blogTime;
    QString blogComment;
    QString blogPraise;
    QString blogCollection;
    QString blogPix;
    QString blogView;
    QString blogType;
    QMap<QString, QString> map;

    QLabel *labelTitle;
    QLabel *labelContent;
    QLabel *labelPix;
    QLabel *labelUser;
    QLabel *labelTime;
    QLabel *labelView;
    QLabel *labelComment;
    QLabel *labelCommentPix;
    QLabel *labelPraise;
    QLabel *labelPraisePix;
    QLabel *labelCollection;
    QLabel *labelCollectionPix;
    QLabel *labelType;

signals:
    void labelClicked(QMap<QString, QString> map, int type);

};

#endif // BLOGITEM_H
